SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE PROCEDURE dbo.[DnnProduct_GetOnlineUsers]
	@PortalID int
AS
	SELECT *
		FROM dbo.DnnProduct_UsersOnline UO
			INNER JOIN dbo.DnnProduct_vw_Users U ON UO.UserID = U.UserID 
			INNER JOIN dbo.DnnProduct_UserPortals UP ON U.UserID = UP.UserId
		WHERE  UP.PortalID = @PortalID AND U.PortalID = @PortalID

GO
